package com.ibeeking.found.common.enums;

public enum RuleSceneEnum {
    INSTOCK_CODE("库存设置入库编号", "instock_code_redis"),
    OUTSTOCK_CODE("库存设置出库编号", "outstock_code_redis");


    private String name;
    private String code;

    RuleSceneEnum(String name, String code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }

    public static String getNameByCode(String code) {
        for (RuleSceneEnum enumObj : values()) {
            if (enumObj.getCode().equals(code)) {
                return enumObj.getName();
            }
        }
        return null;
    }

    public static RuleSceneEnum getEnumByCode(String code) {
        for (RuleSceneEnum enumObj : values()) {
            if (enumObj.getCode().equals(code)) {
                return enumObj;
            }
        }
        return null;
    }
}
